<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>书籍购买</title>
    <link rel="stylesheet" href="/static/css/pay-course.css" />
    <link rel="stylesheet" href="/static/css/styles.css" />
</head>
<body>
<div class="modal-content modal-pay">
    <div class="vip-info-top">
        欢迎您 <span>${user.userName!}</span>,&nbsp;
        您的可用现金 ￥<span>${userAccount.balance/100}</span>元&nbsp;;
        其中 <span>${userAccount.vmAmount/100}</span>元 来自充值 ;
        <span>￥${userAccount.backAmount/100}</span>元 来自返现 ;
    </div>
    <div class="pay-content">
        <div class="book-info-header">
            <div class="list-book-img">
                <img src="${book.cover!}" alt="">
            </div>
            <div class="list-book-content">
                <div class="list-course-title" style="width: 100%">${book.title!}</div>
                <div class="list-book-info">
                    ${book.intro!}
                </div>
                <div class="list-book-price">
                    ￥${book.price/100!}
                </div>
                <div class="list-book-type">${book.categoryName!}</div>
            </div>
        </div>
        <div class="course-body">
            <div class="user-address">
                <h3>选择书籍收货地址</h3>
                <#if address?? && address?size gt 0>
                    <ul class="address-list">
                        <#list address as addres>
                            <li class="addr-item-wrapper <#if addres?index == 0>addr-selected</#if>"  data-id="${addres.id}">
                                <div class="inner-infos">
                                    <div class="addr-hd">
                                        <span>${addres.province!}</span>
                                        <span>（${addres.userName!}收）</span>
                                    </div>
                                    <div class="addr-bd">
                                        <span>${addres.address!}</span>
                                        <span>电话：${addres.mobile!}</span>
                                    </div>
                                </div>
                            </li>
                        </#list>
                    </ul>
                    <#else>
                        <div class="null-page">
                            <div class="icon-null-page"></div>
                            <p>您还没有添加任何收货地址</p>
                        </div>
                </#if>
                <a href="/user/address.html" target="_blank" class="add-address">+ 增加地址</a>
            </div>
        </div>
        <div class="vip-info-footer">
            <div class="pay-wrap">
                <div class="pay-money">应付金额 ￥<span id="current_price">${book.price/100}</span>元</div>
                <div class="pay-search" id="pay-use-weixin" style="display: none">
                    <div class="weixin-qrcode" id="qrcode-image">
                        <img src="/static/images/footer-erweima.png" style="width: 150px;height: 150px;">
                    </div>
                    <div class="weixin-words"><img src="/static/qdxwx/img/weixin.png" alt=""><span>微信扫码支付</span></div>
                </div>
                <div class="pay-money-asset" id="pay-use-money" style="display: block">
                    <div class="asset-count">账户余额 ￥<span style="color: red">${userAccount.balance/100}</span></div>
                    <a class="btn-pay-asset" onclick="payCreate(${book.id},'BOOK')">
                        <#if userAccount.balance gt book.price>
                            账户支付
                            <#else>
                            微信扫码支付
                        </#if>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/static/libs/jquery/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="/static/libs/layui-v2.6.8/layui.js"></script>
<script type="text/javascript" src="/static/libs/jquery/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="/static/js/wxJSAPI.js"></script>
<script type="text/javascript" src="/static/js/order.js?v=1"></script>
<script type="text/javascript">
    $('.address-list li').on('click',function () {//选择收货地址
    $(this).addClass('addr-selected').siblings().removeClass('addr-selected')
    })
</script>
</body>
</html>